import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class script {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		try {
			
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            String filename = "C:/zeus.mdb";
            String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
            database+= filename.trim() + ";DriverID=22;READONLY=true}";
            Connection con = DriverManager.getConnection(database ,"","");            
            
			FileInputStream fis = null;
			BufferedInputStream bis = null;
			DataInputStream dis = null;
			
			File output = new File("C:\\formattedMS_Test_Data.txt");
			
			fis = new FileInputStream(output);

			// Here BufferedInputStream is added for fast reading.
			bis = new BufferedInputStream(fis);
			dis = new DataInputStream(bis);
			
			while (dis.available() != 0) {
				Statement s = con.createStatement();
				s.execute(dis.readLine());		
				s.close();
			}

			// dispose all the resources after using them.
			fis.close();
			bis.close();
			dis.close();
			
            con.close();
        }
		catch(Exception e){
			e.printStackTrace();
		}

	}

}
